package business.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Required;
import org.springframework.transaction.annotation.Transactional;

import vo.Employee;
import business.EmployeeService;
import dao.EmployeeDAO;

public class EmployeeServiceImpl implements EmployeeService{

	private EmployeeDAO employeeDao;
	
	public List<Employee> getAllEmployees() {
		return employeeDao.findAll();
	}
	
	@Required
	public void setEmployeeDao(EmployeeDAO employeeDao) {
		this.employeeDao = employeeDao;
	}

	@Transactional
	public void addEmployee(String name) {
		Employee e = new Employee();
		e.setName(name);
		employeeDao.create(e);
	}

	
}